package home_8_25.dao.impl;

import com.neu.Dao.BaseDao;
import home_8_25.dao.AccountDao;

import java.util.List;
import java.util.Map;

public class AccountDaoImpl extends BaseDao implements AccountDao {


    @Override
    public int accadd(String account) {
        int row = 0;
        String sql = "insert into taccount (income)\n" +
                " values (?)\n";
        row = super.executeUpdate(sql,account);
        return row;
    }

    @Override
    public int accdelete(String account) {
        int row = 0;
        String sql = "update tbusiness set  account=0";
        row = super.executeUpdate(sql,account);

        return row;
    }

    @Override
    public int accupdate(String account) {
        int row = 0;
        String sql = "insert into taccount (income)" +
                " values (?)\n";
        row = super.executeUpdate(sql,account);
        return row;
    }

    @Override
    public List<Map<String, Object>> show(String name) {
        List<Map<String, Object>> list = null;
        String sql = "select *" +
                "from taccount";
        list = super.executeQuery(sql);
        return list;

    }
}
